//
//  BLRepertoryModel.m
//  blanket
//
//  Created by Mac on 2018/1/2.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "BLRepertoryModel.h"

@implementation BLRepertoryModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"repertoryID":@"id"};
}

- (NSArray *)stkeyArray{
    
    if (!_stkeyArray) {
        NSMutableArray * keyArray = [NSMutableArray new];
        NSArray * keeysArray = [self.originDic.allKeys copy];
        for (int i = 0; i < keeysArray.count; i ++) {
            NSString *str = keeysArray[i];
            NSLog(@"%@",str);
            if (![str isEqualToString:@"id"] &&
                ![str isEqualToString:@"uid"] &&
                ![str isEqualToString:@"create_time"] &&
                ![str isEqualToString:@"status"] &&
                ![str isEqualToString:@"type"] &&
                ![str isEqualToString:@"state"]) {
                
                NSString * title = [self titleWithKey:str];
                NSString * num = self.originDic[str];
                NSDictionary * dic = @{BLRepertoryModelTitleKey:title,
                                       BLRepertoryModelNumKey:num};
                [keyArray addObject:dic];
            }
        }
        _stkeyArray = keyArray;
    }

    return _stkeyArray;
}
- (NSString*)titleWithKey:(NSString*)key{
    if ([key isEqualToString:@"bed_one_meter_eight"]) {
        return @"床1.8米";
    }
    if ([key isEqualToString:@"bed_one_meter_five"]) {
        return @"床1.5米";
    }
    if ([key isEqualToString:@"bed_one_meter_two"]) {
        return @"床1.2米";
    }

    if ([key isEqualToString:@"quilt_one_meter_eight"]) {
        return @"被子1.8米";
    }
    if ([key isEqualToString:@"quilt_one_meter_five"]) {
        return @"被子1.5米";
    }
    if ([key isEqualToString:@"quilt_one_meter_two"]) {
       return @"被子1.2米";
    }
    if ([key isEqualToString:@"tick"]) {
        return @"枕套";
    }
    if ([key isEqualToString:@"face_cloth"]) {
        return @"面巾";
    }
    if ([key isEqualToString:@"towel"]) {
        return @"浴巾";
    }

    return @"no";
    
}
@end
